package cn.amebius.simpledocker;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

@SpringBootApplication
@Slf4j
public class SimpledockerApplication {

    public static void main(String[] args) {
        //SpringApplication.run(SimpledockerApplication.class, args);
        System.setProperty("io.netty.resolver.dns.macos.useDefaultResolver", "true");
        SpringApplication app = new SpringApplication(SimpledockerApplication.class);
        ConfigurableApplicationContext context = app.run(args);
        Environment env = context.getEnvironment();
        String port = env.getProperty("server.port");
        log.info(
                "\n----------------------------------------------------------\n\t"
                        + "服务端 '{}' 启动成功!"
                        + "\n\t环境: \t{}"
                        + "\n\t访问地址: \thttp://127.0.0.1:{}"
                        + "\n----------------------------------------------------------",
                env.getProperty("spring.application.name"),
                env.getActiveProfiles(),
                port);
    }

}
